<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>个人中心</title>
    <meta charset="utf-8">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__CSS__/public.min.css">
    <link rel="stylesheet" href="__CSS__/swiper.min.css">
    <style>
        .page--personal .level-vip {
            width: 5vw;
            margin-right: 0;
        }

        .nobility {
            height: 5.26667vw;
            width: 5.44444vw;
        }

        .page--personal .cell__desc {
            margin-top: 0;
        }

        .banner {
            width: 98%;
            height: 90px;
            margin: 1%;
        }

        .swiper-slide {
            transition: 300ms;
            transform: scale(0.8);
        }

        .swiper-slide-active, .swiper-slide-duplicate-active {
            transform: scale(1);
        }

        .swiper-slide img {
            width: 100%;
            height: 90px;
            border-radius: 3px;
        }

        .mt10 {
            margin-top: 0;
        }
    </style>
</head>
<body ontouchstart>
<div class="page">
    <div class="header">
        <h1 class="header__title">个人中心<span class="header__subtitle"></span></h1>
        <div class="header__ft">
            <a class="a1" data-href="settings">设置</a>
        </div>
    </div>
    <div class="page__bd page--personal">
        <!--登录状态-->
        <div class="cells">
            <div class="cell">
                <div class="cell__hd">
                    <div class="user__avatar">
                        {if condition="isset($user['memberId'])"}
                        <img src="{$user.headimgurl}" alt="avatar">
                        {else/}
                        <i class="iconfont user-circle"></i>
                        {/if}
                    </div>
                </div>
                {if condition="isset($user['memberId'])"}
                <div class="cell__bd">
                    <div class="cell__title" style="width: 70%">{$user.memberName}
                        {if condition="$user['vip']"}
                        <span class="level-vip"></span>
                        {/if}
                        {if condition="isset($user['nobility'])"}
                        <img class="nobility" src="{$user['nobility']['img_src']}" alt="">
                        {/if}
                    </div>
                    <div class="cell__desc" style="width: 70%;margin-top: 1.5vw;">G币余额：{$user.user_points}</div>
                    <div class="cell__desc">VIP有效期：{$user.vip_exp_date}</div>
                </div>
                <div class="cell__ft">
                    {if condition="$user['sign']"}
                    <div class="btn btn_default">已签到</div>
                    {else/}
                    <div class="btn btn_primary pd_sign">每日签到</div>
                    {/if}
                </div>
                {else/}
                <div class="cell__bd">
                    <div class="cell__title">登录/注册</div>
                    <div class="cell__desc">登录赚取G币，兑换VIP</div>
                </div>
                {/if}
            </div>
        </div>
        {if condition="$ad"}
        <div class="banner">
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    {volist name="ad" id="vo"}
                    <div class="swiper-slide">
                        {if condition="isset($user['memberId'])"}
                        <a href="{$vo.link}" target="_blank">
                            <img src="{$vo.path}" alt="">
                        </a>
                        {else/}
                        <a href="javascript:window.android._login();" target="_blank">
                            <img src="{$vo.path}" alt="">
                        </a>
                        {/if}
                    </div>
                    {/volist}
                </div>
                <div class="swiper-pagination"></div>
            </div>
        </div>
        {/if}
        <div class="tools mt10">
            <a class="tool-item" data-href="buy_nobility">
                <div class="tool-item__bd">
                    <div class="tool-item__title">爵位购买</div>
                    <div class="tool-item__desc">专属爵位送G币</div>
                </div>
                <div class="tool-item__ft">
                    <div class="tool-item__icon bg--green"><span class="iconfont peerage"></span></div>
                </div>
            </a><a class="tool-item" data-href="my_task">
            <div class="tool-item__bd">
                <div class="tool-item__title">任务中心</div>
                <div class="tool-item__desc">免费赚取G币</div>
            </div>
            <div class="tool-item__ft">
                <div class="tool-item__icon bg--red"><span class="iconfont task"></span></div>
            </div>
        </a><a class="tool-item" data-href="buy_vod_vip?referer=1">
            <div class="tool-item__bd">
                <div class="tool-item__title">VIP兑换</div>
                <div class="tool-item__desc">G币兑换VIP</div>
            </div>
            <div class="tool-item__ft">
                <div class="tool-item__icon bg--yellow"><span class="iconfont vip"></span></div>
            </div>
        </a><a class="tool-item" data-href="my_order">
            <div class="tool-item__bd">
                <div class="tool-item__title">购买记录</div>
                <div class="tool-item__desc">所有购买记录</div>
            </div>
            <div class="tool-item__ft">
                <div class="tool-item__icon bg--violet"><span class="iconfont inventory"></span></div>
            </div>
        </a><a class="tool-item" data-href="my_qq">
            <div class="tool-item__bd">
                <div class="tool-item__title">加入VIP群</div>
                <div class="tool-item__desc">精彩活动不容错过</div>
            </div>
            <div class="tool-item__ft">
                <div class="tool-item__icon bg-roseo"><span class="iconfont package"></span></div>
            </div>
        </a><!--<a class="tool-item" href="#">
            <div class="tool-item__bd">
                <div class="tool-item__title">积分商城</div>
                <div class="tool-item__desc">G币兑换快乐无限</div>
            </div>
            <div class="tool-item__ft">
                <div class="tool-item__icon bg-roseo"><span class="iconfont package"></span></div>
            </div></a><a class="tool-item" href="#">
            <div class="tool-item__bd">
                <div class="tool-item__title">积分活动</div>
                <div class="tool-item__desc">精彩活动不容错过</div>
            </div>
            <div class="tool-item__ft">
                <div class="tool-item__icon bg-blue"><span class="iconfont gift"></span></div>
            </div></a>--></div>
    </div>
</div>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/swiper.min.js"></script>
<script src="__JS__/common.js?v={$Think.config.commonJs}"></script>
<script>
    var vip = "{$user['vip']}";

    $(".a1, .tool-item").click(function () {
        if (Cookies.get('user_token')) {
            if ($(this).data('href') == 'my_qq') {
                if (vip) {
                    window.android._open_url('TmYjhwirs089gTEq20RMN5CgXxBoBPnl');
                } else {
                    window.open('/buy_vod_vip');
                }
            } else {
                window.open('/' + $(this).data('href'));
            }
        } else {
            window.android._login();
        }
    });

    if (!Cookies.get('user_token')) {
        $('.user__avatar, .cell__title, .cell__desc').click(function () {
            window.android._login();
        });
    }

    $(".setting").click(function () {
        window.android._setting();
    });

    $(".pd_sign").click(function (e) {
        $.ajax({
            url: '/pd_task',
            type: "POST",
            dataType: "json",
            data: {task_type: 'pd_sign'},
            success: function (res) {
                if (res.code == 200) {
                    set_cur_cookie('pd_sign', 1);
                    location.reload();
                }
            }
        });
    });

    var swiper = new Swiper('.swiper-container', {
        speed: 500,
        centeredSlides: true,
        loop: true,
        autoplay: {
            delay: 4000
        },
        pagination: {
            el: '.swiper-pagination',
            clickable: true
        }
    });
</script>
<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?7741d4cbd941d985eb296c908ef40bf2";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>